import React, { memo } from 'react'
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'

import Dialog, { Action } from '../../components/vant-weapp/dist/dialog/dialog'
import Toast from '../../components/vant-weapp/dist/toast/toast'
import Notify from '../../components/vant-weapp/dist/notify/notify'

import styles from './index.scss'

// #region 书写注意
//
// 目前 typescript 版本还无法在装饰器模式下将 Props 注入到 Taro.Component 中的 props 属性
// 需要显示声明 connect 的参数类型并通过 interface 的方式指定 Taro.Component 子类的 props
// 这样才能完成类型检查和 IDE 的自动提示
// 使用函数模式则无此限制
// ref: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796
//
// #endregion

type PageStateProps = {}

type PageDispatchProps = {}

type PageOwnProps = {}

type PageState = {}

type IProps = PageStateProps & PageDispatchProps & PageOwnProps & PageState

interface Index {
  props: IProps
}

const Index: React.FC<IProps> = memo(() => {
  return (
    <View className={styles.index}>
      <van-toast id='van-toast' />
      <van-notify id='van-notify' />
      <van-dialog id='van-dialog' />
    </View>
  )
})

export default Index
